import request from '@/utils/request'

//注册接口
//注意使用完整路径而不是补充路径来避免404
export const userRegisterService = ({username,password, repassword})=>
    request.post('https://big-event-vue-api-t.itheima.net/api/reg',{username,password, repassword})
//登录接口
export const userLoginService = ({username,password})=>
    request.post('https://big-event-vue-api-t.itheima.net/api/login',{username,password})
//获取用户基本信息
export const userGetInfoService = ()=>
    request.get('https://big-event-vue-api-t.itheima.net/my/userinfo')

//个人信息维护
//基本资料
export const userDataUpdateService = (data) => request.put('https://big-event-vue-api-t.itheima.net/my/userinfo',data) 
//上传头像
export const userAvatorUpdateService = (avatar)=> request.patch('https://big-event-vue-api-t.itheima.net/my/update/avatar',{avatar})
//重置密码
export const userNewPasswordService = ({ old_pwd, new_pwd, re_pwd }) => request.patch('https://big-event-vue-api-t.itheima.net/my/updatepwd',{ old_pwd, new_pwd, re_pwd })
